﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BGM_Project_Report.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.BGM_Project_Report" %>

<%@ Register src="../Controls/Combo/YearCombo.ascx" tagname="year" tagprefix="uc8" %>
<%@ Register src="../UserControls/DatePicker.ascx" tagname="DatePicker" tagprefix="uc1" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head id="Head1" runat="server">
    <title><asp:Literal runat="Server" id="litTitle"/></title>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <link rel="Stylesheet" href="../../Styles/StyleSheet.css" type="text/css" />
    <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
    <script src="../../Scripts/Common.js" type="text/javascript"></script>
</head>
	<body>
	    <form id="form1" method="post" runat="server" class="defaultFont">
	    
            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
                <script type="text/javascript">

                    function openChangeExp() {

                        var hid = document.getElementById("<%= hdHeaderID.ClientID %>").value;
                        var hname = document.getElementById("<%= hdnProjectName.ClientID %>").value;

                        radopen("BGM_Project_Expense_Change.aspx?hid=" + hid + "&hname=" + hname, "ExpenseChange");

                        return false;
                    }

                    function openProjectControl() {

                        var hid = document.getElementById("<%= hdHeaderID.ClientID %>").value;
                        var hname = document.getElementById("<%= hdnProjectName.ClientID %>").value;

                        radopen("BGM_Project_Control_Expense.aspx?hid=" + hid + "&hname=" + hname, "ProjectControl");

                        return false;
                    }

                    function openProjectOperationReport(seq, status) {

                        radopen("BGM_ProjectOperationReport.aspx?seq=" + seq + "&status=" + status, "ProjectOperationReport");

                        return false;
                    }

                    function openJobSitePass() {
                        radopen("BGM_Project_Pass.aspx?type=pj", "Pass");
                        return false;
                    }

                    function closeRadWindow(sender, args) {
                        return false;
                    }

                    function conFirmDel(str) {
                        return confirm(str);
                    }

                    function closeRadWindow3(sender, args) {
                        $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest('JobSitePass');
                    }

                </script>
            </telerik:RadCodeBlock>

            <%----%>

            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
        
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" > 
            </telerik:RadAjaxLoadingPanel>
        
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="btnChangeExp">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="btnChangeExp" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="btnReturnBudget">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="btnReturnBudget" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="tvlOperation">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="tvlOperation" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="tvlExpense">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="tvlExpense" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="repeaterJobSitePass" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="cmdEndProject">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="cmdEndProject" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="cmdSeeMore1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqReason" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqReasonFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="cmdSeeMore2">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore2" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqObject" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqObjectFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="cmdSeeMore3">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore3" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqTarget" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqTargetFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="cmdSeeMore4">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore4" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqPlan" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqPlanFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="cmdSeeMore5">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore5" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqRemark" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqRemarkFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="cmdEdit">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="cmdEdit" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdSave" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdEndProject" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbGFMISCode" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtGFMISCode" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="panelProjectName" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbStartDate" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbEndDate" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqScopeName" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqReason" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqReasonFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqObject" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqObjectFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore2" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqTarget" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqTargetFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore3" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqPlan" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqPlanFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore4" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqRemark" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqRemarkFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore5" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="dpStartDate" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="dpEndDate" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="ddlBgmReqScopeName" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtBgmReqReason" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtBgmReqObject" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtBgmReqTarget" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtBgmReqPlan" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtBgmReqRemark" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmProjCode" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtBgmProjCode" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="repeaterJobSitePass" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="btnJobSitePass" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="cmdSave">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="cmdEdit" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdSave" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdEndProject" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbGFMISCode" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtGFMISCode" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="panelProjectName" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbStartDate" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbEndDate" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqScopeName" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqReason" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqReasonFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqObject" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqObjectFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore2" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqTarget" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqTargetFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore3" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqPlan" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqPlanFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore4" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqRemark" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmReqRemarkFull" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cmdSeeMore5" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="dpStartDate" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="dpEndDate" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="ddlBgmReqScopeName" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtBgmReqReason" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtBgmReqObject" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtBgmReqTarget" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtBgmReqPlan" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtBgmReqRemark" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="lbBgmProjCode" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="txtBgmProjCode" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="repeaterJobSitePass" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="btnJobSitePass" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
    
            <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" runat="server" Modal="true" KeepInScreenBounds="false" Style="z-index: 8000">
                <Windows>
                    <telerik:RadWindow ID="ExpenseChange" runat="server"  Width="880px" Height="520px" Behaviors="Reload, Close" OnClientClose="closeRadWindow" Skin="WebBlue">
                    </telerik:RadWindow>
                    <telerik:RadWindow ID="ProjectControl" runat="server"  Width="880px" Height="520px" Behaviors="Reload, Close" OnClientClose="closeRadWindow" Skin="WebBlue">
                    </telerik:RadWindow>
                    <telerik:RadWindow ID="ProjectOperationReport" runat="server"  Width="800px" Height="600px" Behaviors="Reload, Close" OnClientClose="closeRadWindow" Skin="WebBlue">
                    </telerik:RadWindow>
                    <telerik:RadWindow ID="TaskLists" runat="server" Width="1000px" Behaviors="Reload, Close" Height='<%# Unit.Pixel(new SsMng().GetUssI(SsMng.SsUserType.Height) - 100) %>'>
                    </telerik:RadWindow>
                    <telerik:RadWindow ID="Pass" runat="server" Width="550px" Height="250px" Behaviors="Reload, Close" OnClientClose="closeRadWindow3">
                    </telerik:RadWindow>
                </Windows>
            </telerik:RadWindowManager>

            <div class="DivInfo" style="font-weight:bold;">
                <table width="100%">
                    <tr>
                        <td>
                            ข้อมูลโครงการ
                        </td>
                        <td align="right">
                            <table>
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="cmdEndProject" runat="server" Text="ปิดโครงการ" CssClass="ControlLinkButton" ForeColor="Red"
                                            OnClientClick="javascript: return confirm('เมื่อปิดโครงการแล้ว เงินในโครงการจะโอนออกมาในกิจกรรมย่อยทั้งหมด ต้องการปิดโครงการนี้หรือไม่?');"
                                            Visible="true" OnClick="cmdEndProject_Click" />
                                    </td>
                                    <td width="75px">
                                        <asp:LinkButton ID="cmdEdit" runat="server" Text="แก้ไขข้อมูล" 
                                            CssClass="LinkButton" onclick="cmdEdit_Click" />
                                        <asp:LinkButton ID="cmdSave" runat="server" Text="บันทึก" CssClass="LinkButton" 
                                            Visible="false" onclick="cmdSave_Click" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="DivBody">
                <table width="100%">
                    <tr valign="top">
                        <td width="50%">
                            <asp:Panel ID="panelProjectName" runat="server" Visible="false">
                                <table width="100%">
                                    <tr valign="top">
                                        <td align="left" width="120px">
                                            ชื่อโครงการ :
                                        </td>
                                        <td align="left">
                                            <%--<input id="lblProjectName" name="lblProjectName" runat="server" type="hidden" />--%>
                                            <telerik:RadTextBox ID="txtProjectName" runat="server" Width="240px" />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        สถานะโครงการ :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lblStatus" runat="server" Visible="false"></asp:Label>
                                        <asp:Label ID="lblStatusName" runat="server" Text="-"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        ปีงบประมาณ :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbBgmYear" runat="server" Text="-"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        รหัสโครงการ :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbBgmProjCode" runat="server" Text="-"></asp:Label>
                                        <telerik:RadTextBox ID="txtBgmProjCode" runat="server" Width="240px" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        รหัส GFMIS :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbGFMISCode" runat="server" Text="-"></asp:Label>
                                        <telerik:RadTextBox ID="txtGFMISCode" runat="server" Width="240px" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        ผลผลิต :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbOutPut" runat="server" Text="-"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        กิจกรรมหลัก :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbAct" runat="server" Text="-"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        กิจกรรมย่อย :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbSubAct" runat="server" Text="-"></asp:Label>
                                        <telerik:RadComboBox ID="ddlSubAct" runat="server"
                                            DataTextField="text" DataValueField="value"
                                            Filter="Contains" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        หน่วยงานหลัก :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbJobSiteMain" runat="server" Text="-"></asp:Label>
                                        <telerik:RadComboBox ID="ddlJobSiteMain" runat="server"
                                            DataTextField="text" DataValueField="value"
                                            Filter="Contains" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        หน่วยงานรอง :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbJobSite" runat="server" Text="-"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        หน่วยงานเพื่อทราบ :
                                    </td>
                                    <td align="left">
                                        <asp:Repeater ID="repeaterJobSitePass" runat="server" OnItemCommand="repeaterJobSitePass_ItemCommand">
                                            <ItemTemplate>
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <asp:ImageButton ID="cmdDelete" runat="server" CommandName="Delete"
                                                                ImageUrl="~/App_UI/Image/Grid/Delete.gif"
                                                                OnClientClick="javascript:return conFirmDel('ยืนยันการลบข้อมูลที่เลือก')" 
                                                                ToolTip="ลบรายการ" />
                                                        </td>
                                                        <td>
                                                            <asp:Label ID="lblBgmProjPassSeq" runat="server" Visible="false" Text='<%# Eval("bgm_proj_pass_seq") %>' />
                                                                <%# Eval("job_site_name") %>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                        <asp:LinkButton ID="btnJobSitePass" runat="server" CssClass="LinkButton" OnClientClick="openJobSitePass()"><img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;&nbsp;&nbsp;เพิ่มหน่วยงานเพื่อทราบ</asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        วันที่เริ่มต้น :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbStartDate" runat="server" Text="-"></asp:Label>
                                        <uc1:DatePicker ID="dpStartDate" runat="server" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        วันที่สิ้นสุด :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbEndDate" runat="server" Text="-"></asp:Label>
                                        <uc1:DatePicker ID="dpEndDate" runat="server" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        ประเภทโครงการ :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbPrjTypeSeq" runat="server" Visible="false"></asp:Label>
                                        <asp:Label ID="lbPrjTypeName" runat="server" Text="-"></asp:Label>
                                        <telerik:RadComboBox ID="ddlPrjTypeSeq" runat="server"
                                            DataTextField="text" DataValueField="value"
                                            Filter="Contains" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="120px">
                                        พื้นที่ดำเนินการ :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbBgmReqScopeSeq" runat="server" Visible="false"></asp:Label>
                                        <asp:Label ID="lbBgmReqScopeName" runat="server" Text="-"></asp:Label>
                                        <telerik:RadComboBox ID="ddlBgmScopeSeq" runat="server"
                                            DataTextField="text" DataValueField="value"
                                            Filter="Contains" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td width="50%">
                            <table width="100%">
                                <tr valign="top">
                                    <td align="left" width="100px">
                                        หลักการ/เหตุผล :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbBgmReqReason" runat="server" Text="-"></asp:Label>
                                        <asp:Label ID="lbBgmReqReasonFull" runat="server" Visible="false"></asp:Label>
                                        <asp:LinkButton ID="cmdSeeMore1" runat="server" CssClass="LinkButton" Text="<เพิ่มเติม>"
                                            OnClick="cmdSeeMore1_Click" Visible="false" />
                                        <telerik:RadTextBox ID="txtBgmReqReason" runat="server" Width="340px" Height="150px" TextMode="MultiLine" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                            <table>
                                <tr valign="top">
                                    <td align="left" width="100px">
                                        วัตถุประสงค์ :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbBgmReqObject" runat="server" Text="-"></asp:Label>
                                        <asp:Label ID="lbBgmReqObjectFull" runat="server" Visible="false"></asp:Label>
                                        <asp:LinkButton ID="cmdSeeMore2" runat="server" CssClass="LinkButton" Text="<เพิ่มเติม>" 
                                            OnClick="cmdSeeMore2_Click" Visible="false" />
                                        <telerik:RadTextBox ID="txtBgmReqObject" runat="server" Width="340px" Height="150px" TextMode="MultiLine" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                            <table>
                                <tr valign="top">
                                    <td align="left" width="100px">
                                        เป้าหมายกิจกรรม :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbBgmReqTarget" runat="server" Text="-"></asp:Label>
                                        <asp:Label ID="lbBgmReqTargetFull" runat="server" Visible="false"></asp:Label>
                                        <asp:LinkButton ID="cmdSeeMore3" runat="server" CssClass="LinkButton" Text="<เพิ่มเติม>" 
                                            OnClick="cmdSeeMore3_Click" Visible="false" />
                                        <telerik:RadTextBox ID="txtBgmReqTarget" runat="server" Width="340px" Height="150px" TextMode="MultiLine" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                            <table>
                                <tr valign="top">
                                    <td align="left" width="100px">
                                        วิธีการดำเนินการ :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbBgmReqPlan" runat="server" Text="-"></asp:Label>
                                        <asp:Label ID="lbBgmReqPlanFull" runat="server" Visible="false"></asp:Label>
                                        <asp:LinkButton ID="cmdSeeMore4" runat="server" CssClass="LinkButton" Text="<เพิ่มเติม>" 
                                            OnClick="cmdSeeMore4_Click" Visible="false" />
                                        <telerik:RadTextBox ID="txtBgmReqPlan" runat="server" Width="340px" Height="150px" TextMode="MultiLine" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                            <table>
                                <tr valign="top">
                                    <td align="left" width="100px">
                                        หมายเหตุ :
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="lbBgmReqRemark" runat="server" Text="-"></asp:Label>
                                        <asp:Label ID="lbBgmReqRemarkFull" runat="server" Visible="false"></asp:Label>
                                        <asp:LinkButton ID="cmdSeeMore5" runat="server" CssClass="LinkButton" Text="<เพิ่มเติม>" 
                                            OnClick="cmdSeeMore5_Click" Visible="false" />
                                        <telerik:RadTextBox ID="txtBgmReqRemark" runat="server" Width="340px" Height="150px" TextMode="MultiLine" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
            <asp:Label ID="lbControlID" runat="server" Text="" Visible="true"></asp:Label>                                            
            <asp:HiddenField ID="hdType" runat="server"></asp:HiddenField>
            <asp:HiddenField ID="hdHeaderID" runat="server"></asp:HiddenField>
            <asp:HiddenField ID="hdnProjectName" runat="server"></asp:HiddenField>

            <div class="DivInfo" style="font-weight:bold;">
                <table width="100%">
                    <tr>
                        <td>
                            ข้อมูลค่าใช้จ่ายคงเหลือในโครงการ
                        </td>
                        <td align="right">
                            <asp:LinkButton ID="btnChangeExp" runat="server" Text="แก้ไขข้อมูลค่าใช้จ่าย" 
                                CssClass="LinkButton" OnClientClick="openChangeExp()" />
                        </td>
                    </tr>
                </table>
            </div>
            <telerik:RadTreeList ID="tvlExpense" runat="server" AutoGenerateColumns="false"
                DataKeyNames="child_value" ParentDataKeyNames="parent_value" AllowLoadOnDemand="false"
                Width="965px" OnNeedDataSource="tvlExpense_NeedDataSource">
                <Columns>
                    <telerik:TreeListBoundColumn DataField="child_value" UniqueName="child_value" Visible="false">
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="parent_value" UniqueName="parent_value" Visible="false">
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="text" UniqueName="text" HeaderText="แหล่งเงิน/ค่าใช้จ่าย">
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="cal_amount" UniqueName="cal_amount" HeaderText="จำนวนเงินคงเหลือ (บาท)"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="150px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                </Columns>
            </telerik:RadTreeList>
            <table width="100%">
                <tr>
                    <td align="right">
                        รวม :
                    </td>
                    <td width="150px" align="right">
                        <asp:Label ID="lblSumExpense" runat="server" ForeColor="Blue" />
                    </td>
                    <td width="5px">
                    </td>
                </tr>
            </table>
            <div class="DivInfo" style="font-weight:bold;">
                ประวัติการเปลี่ยนแปลงค่าใช้จ่าย
            </div>
            <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="gridReport5" runat="server" AllowMultiRowSelection="false"
                AutoGenerateColumns="False" OnItemDataBound="gridReport5_ItemDataBound" 
                GridLines="None" MasterTableView-GridLines="None" Width="965px">
                <mastertableview ShowFooter="true" NoMasterRecordsText="... ไม่มีข้อมูล ..." 
                    CommandItemDisplay="none" width="100%" GroupLoadMode="Client">
                <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <groupbyfields>
                            <telerik:GridGroupByField FieldName="bgm_source_seq" HeaderText="&nbsp;" />
                        </groupbyfields>
                        <selectfields>
                            <telerik:GridGroupByField FieldName="bgm_source_name" HeaderText="แหล่งเงิน :" HeaderValueSeparator="" />
                        </selectfields>
                    </telerik:GridGroupByExpression>
                    <telerik:GridGroupByExpression>
                        <groupbyfields>
                            <telerik:GridGroupByField FieldName="bgm_exp_grp_seq" HeaderText="&nbsp;" />
                        </groupbyfields>
                        <selectfields>
                            <telerik:GridGroupByField FieldName="bgm_exp_grp_name" HeaderText="งบรายจ่าย :" HeaderValueSeparator="" />
                        </selectfields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
                <Columns>
                    <telerik:GridBoundColumn DataField="bgm_proj_exp_seq" UniqueName="bgm_proj_exp_seq" Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="created_when"
                        FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="รายการ" ItemStyle-HorizontalAlign="Left" 
                        UniqueName="created_when"><%--DataFormatString="{0:d}"--%>
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="bgm_exp_name"
                        FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="ค่าใช้จ่าย" ItemStyle-HorizontalAlign="Left" 
                        UniqueName="bgm_exp_name" >
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="cal_amount"
                        HeaderText="วงเงิน (บาท)" Aggregate="Sum"
                        DataFormatString="{0:#,##0.00}"
                        HeaderStyle-HorizontalAlign="Center"
                        UniqueName="cal_amount" Visible="true">
                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:GridBoundColumn>
                </Columns>
                </mastertableview>
                <ClientSettings>
                    <Selecting AllowRowSelect="false" />
                </ClientSettings>
            </telerik:RadGrid>
                
            <div class="DivInfo" style="font-weight:bold;">
                ขออนุมัติโครงการ
            </div>
            <telerik:RadTreeList ID="tvlOperation" runat="server" AutoGenerateColumns="false"
                DataKeyNames="child_seq" ParentDataKeyNames="parent_seq" AllowLoadOnDemand="false"
                Width="965px" OnNeedDataSource="tvlOperation_NeedDataSource" 
                OnItemDataBound="tvlOperation_ItemDataBound"><%----%>
                <Columns>
                    <telerik:TreeListBoundColumn DataField="child_seq" UniqueName="child_seq" Visible="false">
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="parent_seq" UniqueName="parent_seq" Visible="false">
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="record_status" UniqueName="record_status" Visible="false">
                    </telerik:TreeListBoundColumn>

                    <telerik:TreeListTemplateColumn DataField="name" UniqueName="name" HeaderText="">
                        <ItemTemplate>
                            <asp:Label ID="lblName" runat="server" Text='<%# Eval("name") %>' />
                            <asp:LinkButton ID="cmdViewOperation" runat="server" Text='<%# Eval("name") %>' ForeColor="Blue"
                                OnClientClick='<%# string.Format("return openProjectOperationReport(\"{0}\", \"{1}\");", Eval("child_seq").ToString().Replace("/", ""), Eval("record_status")) %>'
                                />
                        </ItemTemplate>
                    </telerik:TreeListTemplateColumn>
                    <%--<telerik:TreeListBoundColumn DataField="record_status_name" UniqueName="record_status_name" HeaderText="สถานะ">
                        <HeaderStyle Width="70px" />
                    </telerik:TreeListBoundColumn>--%>
                    <telerik:TreeListBoundColumn DataField="operation_amount" UniqueName="operation_amount" HeaderText="อนุมัติ"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="100px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="transfer_amount" UniqueName="transfer_amount" HeaderText="โอน/รับโอน"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="100px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="reserve_amount" UniqueName="reserve_amount" HeaderText="จองเงิน"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="100px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="moneyreq_amount" UniqueName="moneyreq_amount" HeaderText="ตั้งเบิก"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="100px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="pay_amount" UniqueName="pay_amount" HeaderText="จ่าย"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="100px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="return_amount" UniqueName="return_amount" HeaderText="คืน"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="100px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="remain_amount" UniqueName="remain_amount" HeaderText="คงเหลือ"
                        DataFormatString="{0:N2}">
                        <HeaderStyle Width="100px" HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right" />
                    </telerik:TreeListBoundColumn>
                </Columns>
            </telerik:RadTreeList>
		</form>
	</body>
</html>
